function IsoMap()
{
	this._isoData = new Object();
}

POO.extend( IsoMap, Map );


	IsoMap.prototype._isoData = null;
	IsoMap.prototype.cellW = 64;
	IsoMap.prototype.cellH = 32;

	IsoMap.prototype.addSpriteAt = function( p_spr, p_layerId, p_x, p_y )
	{
		var layer = this.getLayer( p_layerId );
		
		if( layer == null )
		{
			return;
		}
		
		var isoCoords = IsoUtils.screenToIso( p_x, p_y );
		var row = isoCoords.row;
		var col = isoCoords.col;
		var remanagedCoords = IsoUtils.isoToScreen( row, col, this.cellW, this.cellH );
		var old = this._getIsoSpriteAt( p_layerId, row, col );
		
		if( old != null )
		{
			this.removeSprite(old);
		}
		
		p_spr.x = remanagedCoords.x;
		p_spr.y = remanagedCoords.y;
		
		this._pushIsoSpriteAt( p_spr, p_layerId, row, col );
		
		layer.displayList.addChild( p_spr );
		p_spr.transformGroup = this.camera.transformGroup;
	};
	
	IsoMap.prototype._pushIsoSpriteAt = function( p_spr, p_layerId, p_row, p_col )
	{
		if( !this._isoData[layerId] )
			this._isoData[layerId] = new Array();
		
		if( this._isoData[layerId][p_row] == undefined )
			this._isoData[layerId][p_row] = new Array();
			
		this._isoData[layerId][p_row][p_col] = p_spr;
	};
	
	IsoMap.prototype._getIsoSpriteAt = function( p_layerId, p_row, p_col )
	{
		if( !this._isoData[layerId] )
			this._isoData[layerId] = new Array();
		
		if( this._isoData[layerId][p_row] == undefined )
			this._isoData[layerId][p_row] = new Array();
			
		if( this._isoData[layerId][p_row][p_col] == undefined )
		{
			return null;
		}
		
		return this._isoData[layerId][p_row][p_col];
	};